<<<<<<< HEAD
<<<<<<< HEAD
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
=======
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
>>>>>>> refs/heads/dev
<title>Insert title here</title>
</head>
<body>

=======
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>员工签到</title>
<!-- jquery -->
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<!-- bootstrap -->
<link rel="stylesheet" href="../css/bootstrap.min.css">
<script src="../js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
	$(function(){
		//动态显示当前时间
		setInterval(function(){
			var nowTime=getNowTime();
			$("#showTime").text(nowTime);
		},1000);
		
		//点击签到按钮
		$("#qd").click(function(){
			$(this).attr('disabled',true);
			var nowTime=getNowTime();
			$(this).text("上班签到  ("+nowTime+")");
			$.ajax({
				url:"<c:url value='/arrive' />",
				dataType:'json',
				type:'post',
				success:function(re){
					if(re.addFlag){
						alert("签到成功");
					}
				}
			})
		})
		//点击签退按钮
		$("#qt").click(function(){
			$(this).attr('disabled',true);
			var nowTime=getNowTime();
			$(this).text("下班签退  ("+nowTime+")");
			$.ajax({
				url:"<c:url value='/leave' />",
				dataType:'json',
				type:'post',
				success:function(re){
					
				}
			})
		})
	})
	//获取当前时间
	function getNowTime(){
		var d=new Date();
		var year=d.getFullYear();
		var month=d.getMonth()+1;
		var day=d.getDate();
		var h = d.getHours(); 
		var m = d.getMinutes(); 
		var s = d.getSeconds(); 
		month = month<10 ? "0" + month : month;
		day = day<10 ? "0"+day : day;
		h = h<10 ? "0"+h :h;
		m = m<10 ? "0"+m : m;
		s = s<10? "0"+s : s;
		var weekArray = new Array('星期日','星期一','星期二','星期三','星期四','星期五','星期六');
		var weekindex=d.getDay();
		var week=weekArray[weekindex];
		
		var nowTime=year+"-"+month+"-"+day+" "+week+" "+h+":"+m+":"+s;
		return nowTime;
	}
</script>
<style type="text/css">
	#showTime{
		font-size:28px;
		font-weight:bold;
		color:#5599ff;
		margin-left:30px;
		margin-top:30px;
		font-family:'幼圆';
	}
	#arrive,#leave{
		width:400px;
		margin:0 auto;
		margin-top:50px;
	}
</style>
</head>
<body>
	<div id="showTime"></div>
	<div id="arrive"><a id="qd" class="btn btn-primary btn-stack btn-block btn-lg">上班签到</a></div>
	<div id="leave"><a id="qt" class="btn btn-primary btn-stack btn-block btn-lg">下班签退</a></div>
>>>>>>> refs/remotes/devo/master
</body>
</html>